
<form method="POST" id='newcommission-edit-form' action="index.php?app=inman&ctl=admin_commission&act=toAdd" class="tableform">
    <div class="division">
        <table width="100%" >
            <tr><th><em class="red">*</em><{t}>名称：<{/t}></th><td><{input type="text" name="com[com_name]"  onchange="nameCheck(this)" size="20" vtype="required"}><span></span></td></tr>
            <tr><th><em class="red">*</em><{t}>佣金比例：<{/t}></th><td><{input type="text" name="com[com_percentage]" size="20" vtype="required"}></td></tr>
            <tr><th><em class="red">*</em><{t}>是否启用：<{/t}></th><td><input type="radio" name="com[status]" value='0' checked='checked'/>禁用<input type="radio" value='1' name='com[status]'/>启用</td></tr>
            <tr><th>佣金模式：</th><td>
            	<select name='com[com_type]'>
            		<option value='0'>默认</option>
            		<option value='1'>线上佣金规则</option>
            		<option value='2'>官网佣金规则</option>
            		<option value='3'>非官网佣金规则</option>
            	</select>
            <span></span></td></tr>
            <tr><th>最小值：</th><td><{input type="text" name="com[min_value]" size="20"}><span></span></td></tr>
            <tr><th>最大值：</th><td><{input type="text" name="com[max_value]" size="20" }><span></span></td></tr>
            <tr><th>备注：</th><td><textarea cols='40' rows='5' name="com[com_remark]"></textarea><span></span></td></tr>
            
            <!-- <tr><th><em class="red">*</em><{t}>xxx：<{/t}></th><td><{input type='select' name='member_lv[member_group_id]' vtype="required" options=$mem.lv.options value=$mem.lv.value }></td></tr>
        	 -->
        </table>
        <hr style="margin:5px 0;">
	</div>
	<{area inject='.mainFoot'}>
		<div class="table-action"><{button type="submit"  label=$___inman="保存"|t:'inman' id='newcommission-edit-form-submit'}></div>
	<{/area}>
</form>





<script type="text/javascript">
(function(){
    var _form = $('newcommission-edit-form');
    var btn =$('newcommission-edit-form-submit');
    var finder = finderGroup['<{$env.get.finder_id}>'];

    _form.store('target',{
        onComplete:function(){            

        },
        onSuccess:function(response){
            var hash_res_obj = JSON.decode(response);
            if (hash_res_obj.success != undefined && hash_res_obj.success != "")
            {
                try{
                    var _dialogIns = btn.getParent('.dialog').retrieve('instance');
                }catch(e){}

                if(_dialogIns)
                {
                    _dialogIns.close();
                    finder.refresh.delay(400,finder);
                }
            }
            else
            {
                //alert(hash_res_obj.error);
            }            
        }
    });

    btn.addEvent('click',function(){
        _form.fireEvent('submit',{stop:$empty});



    });

})();

</script>